{% extends 'layouts/base.html' %}
{% block content %}
<div class="row">
    <div class="col-xs-12">
        <!-- PAGE CONTENT BEGINS -->
        <form action="{{ url('backend/wxmessage/add') }}" class="form-horizontal" role="form" method="post" enctype="multipart/form-data">

            <div class="form-group{% if errors['mfromusername'] is not empty %} has-error{%endif%}">
                <label for="mfromusername" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">发送者<span class="red">*</span></label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="mfromusername" placeholder="发送者" name="mfromusername" class="col-xs-12" value="{{wxmessage.mfromusername}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['mfromusername'] is not empty %}{{errors['mfromusername']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['mtousername'] is not empty %} has-error{%endif%}">
                <label for="mtousername" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">接受者<span class="red">*</span></label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="mtousername" placeholder="接受者" name="mtousername" class="col-xs-12" value="{{wxmessage.mtousername}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['mtousername'] is not empty %}{{errors['mtousername']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['mcreatetime'] is not empty %} has-error{%endif%}">
                <label for="mcreatetime" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">产生时间</label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="mcreatetime" placeholder="产生时间" name="mcreatetime" class="col-xs-12" value="{{wxmessage.mcreatetime}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['mcreatetime'] is not empty %}{{errors['mcreatetime']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['mtype'] is not empty %} has-error{%endif%}">
                <label for="mtype" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">消息类型</label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="mtype" placeholder="消息类型" name="mtype" class="col-xs-12" value="{{wxmessage.mtype}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['mtype'] is not empty %}{{errors['mtype']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['mcontent'] is not empty %} has-error{%endif%}">
                <label for="mcontent" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">消息内容</label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="mcontent" placeholder="消息内容" name="mcontent" class="col-xs-12" value="{{wxmessage.mcontent}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['mcontent'] is not empty %}{{errors['mcontent']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['mpicurl'] is not empty %} has-error{%endif%}">
                <label for="mpicurl" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">图片链接</label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="mpicurl" placeholder="图片链接" name="mpicurl" class="col-xs-12" value="{{wxmessage.mpicurl}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['mpicurl'] is not empty %}{{errors['mpicurl']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['mmediaid'] is not empty %} has-error{%endif%}">
                <label for="mmediaid" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">图片消息媒体id</label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="mmediaid" placeholder="图片消息媒体id" name="mmediaid" class="col-xs-12" value="{{wxmessage.mmediaid}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['mmediaid'] is not empty %}{{errors['mmediaid']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['mformat'] is not empty %} has-error{%endif%}">
                <label for="mformat" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">语音格式</label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="mformat" placeholder="语音格式" name="mformat" class="col-xs-12" value="{{wxmessage.mformat}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['mformat'] is not empty %}{{errors['mformat']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['mthumbmediaid'] is not empty %} has-error{%endif%}">
                <label for="mthumbmediaid" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">视频消息缩略图id</label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="mthumbmediaid" placeholder="视频消息缩略图id" name="mthumbmediaid" class="col-xs-12" value="{{wxmessage.mthumbmediaid}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['mthumbmediaid'] is not empty %}{{errors['mthumbmediaid']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['mtitle'] is not empty %} has-error{%endif%}">
                <label for="mtitle" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">消息标题</label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="mtitle" placeholder="消息标题" name="mtitle" class="col-xs-12" value="{{wxmessage.mtitle}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['mtitle'] is not empty %}{{errors['mtitle']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['mdescription'] is not empty %} has-error{%endif%}">
                <label for="mdescription" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">消息描述</label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="mdescription" placeholder="消息描述" name="mdescription" class="col-xs-12" value="{{wxmessage.mdescription}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['mdescription'] is not empty %}{{errors['mdescription']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['murl'] is not empty %} has-error{%endif%}">
                <label for="murl" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">消息链接</label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="murl" placeholder="消息链接" name="murl" class="col-xs-12" value="{{wxmessage.murl}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['murl'] is not empty %}{{errors['murl']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['mid'] is not empty %} has-error{%endif%}">
                <label for="mid" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">微信服务器消息编号</label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="mid" placeholder="微信服务器消息编号" name="mid" class="col-xs-12" value="{{wxmessage.mid}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['mid'] is not empty %}{{errors['mid']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['mstate'] is not empty %} has-error{%endif%}">
                <label for="mstate" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">消息状态0为未回复</label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="mstate" placeholder="消息状态0为未回复" name="mstate" class="col-xs-12" value="{{wxmessage.mstate}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['mstate'] is not empty %}{{errors['mstate']}}{% else %} {%endif%} </div>
            </div>



            <div class="clearfix form-actions">
                <div class="col-md-offset-3 col-md-9">
                    <button class="btn btn-info" type="submit">
                        <i class="ace-icon fa fa-check bigger-110"></i>
                        提交
                    </button>

                    &nbsp; &nbsp; &nbsp;
                    <button class="btn" type="reset">
                        <i class="ace-icon fa fa-undo bigger-110"></i>
                        重置
                    </button>
                </div>
            </div>
        </form>
    </div><!-- /.col -->
</div><!-- /.row -->

{% endblock %}
{% block script %}

<script type="text/javascript">
    $(document).ready(function(){

        $(".ace-switch").each(function () {
            var aceswitch = this;

            aceswitch.addEventListener("click", function(){
                id = this.id.replace("_radio", "");
                if(this.checked){
                    $("#"+id).val('1');
                } else {
                    $("#"+id).val('0');
                }
                });
        });
    });
</script>
{% endblock %}
